package com.his.dao.jpa;

import java.util.List;

import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;

import com.his.pojos.jpa.HisApparatus;

public interface MxjApparatusDAO extends CrudRepository<HisApparatus, Long> {
	@Query("from HisApparatus")
	public List<HisApparatus> findHisApparatusByPage(Pageable pageable);
	
	@Query("from HisApparatus ha where ha.cpName like :cpName")
	public List<HisApparatus> findBypageAndcpName(Pageable pageable,@Param("cpName")String cpName);
	
	@Query("select count(*) from HisApparatus ha where ha.cpName like :cpName")
	public String findBypageAndcpNamesize(@Param("cpName")String cpName);
	
	@Query("select qxNo from HisApparatus where cpName=:cpName")
	public String findAPPId(@Param("cpName")String cpName);
	
}
